Repository navigation
Cape Town | 26-ITP-Sept | Vaidah Simenti | Sprint 2 | Coursework/Implement and Rewrite Tests - #1676
Open
Vaidah-dev wants to merge 12 commits into
Open
Vaidah-dev wants to merge 12 commits into
Vaidah-dev wants to merge 12 commits into
Conversation
hackertainment
left a comment
There was a problem hiding this comment.
Thank you for you coursework and just some minor fixes required. Please keep it up.
There was a problem hiding this comment.
Good coverage of test cases (except angle 90 tested two times ^^" ).
| }); | ||
|
|
||
| test("Negative cases", () => { | ||
| assert.equal(isProperFraction(-2, 1), true); |
| test("Negative cases", () => { | ||
| assert.equal(isProperFraction(-2, 1), true); | ||
| assert.equal(isProperFraction(1, -2), false); | ||
| assert.equal(isProperFraction(-1, -2), false); |
| }); | ||
|
|
||
| test("Zero cases", () => { | ||
| assert.equal(isProperFraction(0, 1), true); |
| }); | ||
|
|
||
| test("Zero cases", () => { | ||
| expect(isProperFraction(0, 1)).toEqual(true); |
| test("Negative cases", () => { | ||
| expect(isProperFraction(-2, 1)).toEqual(true); | ||
| expect(isProperFraction(1, -2)).toEqual(false); | ||
| expect(isProperFraction(-1, -2)).toEqual(false); |
| }); | ||
|
|
||
| test("Negative cases", () => { | ||
| expect(isProperFraction(-2, 1)).toEqual(true); |
| expect(() => getCardValue("♠")).toThrow(); | ||
| expect(() => getCardValue("11♠")).toThrow(); | ||
| expect(() => getCardValue("hello")).toThrow(); | ||
| expect(() => getCardValue("")).toThrow(); |
There was a problem hiding this comment.
Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?
| assert.throws(() => getCardValue("11♠")); | ||
| assert.throws(() => getCardValue("1♠")); | ||
| assert.throws(() => getCardValue("hello")); | ||
| assert.throws(() => getCardValue("")); |
There was a problem hiding this comment.
Would this test case throw your Expected a number followed by a suit, but got "" error or throwing another type or error?
Author
|
Thank you for the review! I've addressed all the comments: fixed the isProperFraction tests, added error message checks to getCardValue, and cleaned up get-angle-type. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self checklist
Task code
(CYF-1059).
Changelist
-Implemented :
getAngleType,isProperFraction,getCardValueand for each function ran tests using Node's built in test runner as well as rewriting using Jest.